package cn.shop.dys.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

import cn.shop.dys.R;
import cn.shop.dys.bean.CategoryInfo;
import cn.shop.dys.bean.CategoryType;


public class CategoryAdapter<T> extends ArrayAdapter {
	List<CategoryInfo> first;
	public  int preDisableIndex=-1;



	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView textView = (TextView) super.getView(position, convertView, parent);
		if (position == 0) {
			textView.setEnabled(false);
			preDisableIndex = 0;

		}
		CategoryInfo info = first.get(position);
		textView.setText(info.name);
//            MyLogger.jLog().i("getView---------------");
		return textView;
	}





	public CategoryAdapter(Context context, int resource) {
		super(context, resource);
	}

	public CategoryAdapter(Context context, int resource, int textViewResourceId) {
		super(context, resource, textViewResourceId);
	}

	public CategoryAdapter(Context context, int resource, Object[] objects) {
		super(context, resource, objects);
	}

	public CategoryAdapter(Context context, int resource, int textViewResourceId, Object[] objects) {
		super(context, resource, textViewResourceId, objects);
	}

	public CategoryAdapter(Context context, int resource, List objects) {
		super(context, resource, objects);
		first=objects;
	}

	public CategoryAdapter(Context context, int resource, int textViewResourceId, List objects) {
		super(context, resource, textViewResourceId, objects);
		first=objects;
	}
}
